package com.example.springLearning.part12.controller;

import com.example.springLearning.part12.dto.StudentDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/spring/part12")
public class Spring12Controller {

    @RequestMapping(path = "/hi1", method = RequestMethod.GET)
    public StudentDTO hi1() {
        return new StudentDTO("xiaoming", Integer.valueOf(12));
    }

    @PostMapping("/hi2")
    public StudentDTO hi2(@RequestBody StudentDTO studentDTO) {
        System.out.println("ssss");
        return studentDTO;
    }
}
